﻿@using NetCoreCMS.Framework.Core.Models.ViewModels
@model StartupViewModel

@{
    Layout = Constants.AdminLayoutName;
    ViewData["PageTitle"] = "Startup";
    ViewData["PageSubtitle"] = "Set Startup Page";
}

<div class="row">
    @if (ViewBag.Message != null)
    {
        <div class="alert alert-danger">@ViewBag.Message</div>
    }
    <div class="col-sm-12">

        <form class="form-horizontal" asp-controller="Admin" asp-action="Startup" method="post">

            <div class="form-group">
                <div class="col-sm-1"></div>
                <div class="col-sm-5"><h3>Startup Page according to User Role</h3></div>
            </div>

            <div class="form-group">
                <div class="col-sm-1 text-right"></div>
                <div class="col-sm-5">
                    <select name="Role" class="form-control">
                        <option>Select Role</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-1 text-right"><input type="radio" name="RoleStartupType" value="Url" @ViewBag.DefaultChecked /></div>
                <div class="col-sm-5"><input type="text" name="Url" value="@Model.Url" class="form-control" /></div>
            </div>

            <div class="form-group">
                <div class="col-sm-1 text-right"><input type="radio" name="RoleStartupType" value="Page" @ViewBag.PageChecked /></div>
                <div class="col-sm-5">
                    <select asp-for="PageId" asp-items="@Model.Pages" class="form-control">
                        <option>Select a page</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-1 text-right"><input type="radio" name="RoleStartupType" value="Category" @ViewBag.CategoryChecked /></div>
                <div class="col-sm-5">
                    <select asp-for="CategoryId" asp-items="@Model.Categories" class="form-control">
                        <option>Select a category</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-1 text-right"><input type="radio" name="RoleStartupType" value="Post" @ViewBag.PostChecked /></div>
                <div class="col-sm-5">
                    <select asp-for="PostId" asp-items="@Model.Posts" class="form-control">
                        <option>Select a post</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-1 text-right"><input type="radio" name="RoleStartupType" value="Module" @ViewBag.ModuleChecked /></div>
                <div class="col-sm-5">
                    <select asp-for="ModuleSiteMenuUrl" asp-items="@Model.ModuleSiteMenus" class="form-control">
                        <option>Select module menu</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-1"></div>
                <div class="col-sm-5"><input class="btn btn-primary" type="submit" value="Update" /></div>
            </div>
        </form>
    </div>
</div>
